import { Type } from "../../Decorator/Decorator";
import { JsonHelper } from "../Serialize/JsonHelper";

export interface ITypeBind {

    SetupType(value: any): void;

}

export interface INamedObject {
    clazzType: Type;
}

export abstract class NamedObject implements INamedObject {

    clazzType: Type;

    constructor() {
        this.clazzType = this.constructor.name;
    }

    GetClassType(): Type {
        return this.clazzType;
    }

    ToString() {
        return JsonHelper.ToJson(this);
    }

}

export abstract class NamedSystemObject extends NamedObject {

    entityType: Type;

    constructor() {
        super();
    }

}